package com.xiyi.shouxin.entity.admin.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;
import org.springframework.lang.Nullable;

import com.xiyi.shouxin.entity.admin.Role;

public class RoleMapper implements RowMapper<Role> {
    @Override
    @Nullable
    public Role mapRow(@Nullable ResultSet rs, int rowNum) throws SQLException {
        Role role = new Role();
        if (rs == null) {
            return role;
        }
        role.setId(rs.getLong("id"));
        role.setRoleName(rs.getString("role_name"));
        return role;
    }
}
